<style>
	.cntForm td
	{ldelim}
		padding: 8px;
	{rdelim}
</style>

{include file="stddecor.form.open.tpl" }
<table cellspacing="0" class="objHeader">
<tr>
    <td class="objHeader-td-icon"><img src="{$SPIcfg.dir.pubsite_styles|escape}manage/image/topic_icons/{$data.topic|escape}_{$data.tmode|escape}.{if $data.tmode == 'catalog'}png{else}gif{/if}" /></td>
    <td class="objHeader-td-header">
        <div>
            <h1>{$data.title|escape}</h1>
            <h2>{$data.subtitle|escape}</h2>
        </div>
		
		<div class="left">
			{foreach from=$data.linkway item=linkway_item name=linkway }
				{if $smarty.foreach.linkway.last }
					<div class="left">{include file="obj.button.tpl" name=$linkway_item.name link=false icon="folder_active" }</div>
				{else}
					<div class="left">{include file="obj.button.tpl" name=$linkway_item.name link=$linkway_item.link icon="folder" }</div>
					<div class="left" style="padding: 3px 6px 0;">/</div>
				{/if}
			{/foreach}
		</div>

        <div class="objHeader-action_buttons">
            <div class="right">{include file="obj.button.tpl" name="Назад" link=$data.link_back icon="back" }</div>
            <br class="clear" />
        </div>
    </td>
</tr>
</table>
{include file="stddecor.form.close.tpl" }

{* ************************************************************************* *}

{if $content.media }
    {include file="media/manager.tpl" item_title="Главное изображение %s" media=$content.media }
{/if}

{* ************************************************************************* *}

{include file="stddecor.form.open.tpl" }

<form id="cntForm" name="cntForm" method="post" action="{$data.link_form_submit|escape}">
{foreach from=$data.formvars key=varname item=varvalue }
<input type="hidden" name="{$varname|escape}" value="{$varvalue|escape}" />
{/foreach}

<center>
<table cellspacing="0" cellpadding="0" class="cntForm">
<tr>
    <td class="cntForm-td-title"><div>Активность:</div></td>
    <td class="cntForm-td-object">
        <select class="select" name="field[workstatus]">
            <option value="1"{if '1' == $content.item_fields.workstatus } selected="selected"{/if}>Включено</option>
            <option value="0"{if '0' == $content.item_fields.workstatus } selected="selected"{/if}>Выключено</option>
        </select>
    </td>
    <td class="cntForm-td-error buggy_obj buggy_obj__workstatus"></td>
</tr>

<tr><td>&nbsp;</td></tr>

{if $data.list_types|@count > 1 }
    <tr>
        <td class="cntForm-td-title"><div>Тип записи:</div></td>
        <td class="cntForm-td-object">
            <select class="select" name="field[type]">
            <option value="0">&lt;укажите значение&gt;</option>
            {foreach from=$data.list_types key=type_key item=type_name }
                <option value="{$type_key|escape}"{if $type_key == $content.item_fields.type } selected="selected"{/if}>{$type_name|escape}</option>
            {/foreach}
            </select>
        </td>
        <td class="cntForm-td-error buggy_obj buggy_obj__type"></td>
    </tr>
{elseif $data.const_type }
    <input type="hidden" name="field[type]" value="{$data.const_type|escape}" />
{/if}
{if in_array( $data.tmode, array( 'gallery', 'partners', 'catalog' ) ) === false }
<tr>
	<td class="cntForm-td-title"><div>Дата публикации:</div></td>
	<td class="cntForm-td-object">
		<input type="text" class="text handler__jQueryUI__datepicker" name="field[pubdate]" value="{$content.item_fields.pubdate|escape}" style="width: 40%" maxlength="10" />
	</td>
	<td class="cntForm-td-error buggy_obj buggy_obj__pubdate"></td>
</tr>
<tr><td>&nbsp;</td></tr>
{/if}

{if $data.brands|@count > 0}
<tr>
    <td class="cntForm-td-title"><div>Бренд:</div></td>
    <td class="cntForm-td-object">
		<select name="field[brand]" class="select">
			{foreach from=$data.brands item=brand}
				<option value="{$brand.id|escape}" {if $brand.id == $content.item_fields.brand}selected{/if}/> {$brand.name|escape}
			{/foreach}
		</select>
    </td>
    <td class="cntForm-td-error buggy_obj buggy_obj__brand"></td>
</tr>
{/if}

<tr>
    <td class="cntForm-td-title"><div>Найменование:</div></td>
    <td class="cntForm-td-object">
        <input type="text" class="text" name="field[name]" value="{$content.item_fields.name|escape}" maxlength="255" />
    </td>
    <td class="cntForm-td-error buggy_obj buggy_obj__name"></td>
</tr>

<tr><td>&nbsp;</td></tr>

{if $data.params}
	{include file="content/form.params.tpl" params=$data.params }

	<tr><td>&nbsp;</td></tr>
{/if}

<tr>
    <td class="cntForm-td-title"><div>Анонс:</div></td>
    <td class="cntForm-td-object">
        <textarea cols="60" rows="4" class="textarea" name="field[anons]">{$content.item_fields.anons|escape}</textarea>
    </td>
    <td class="cntForm-td-error buggy_obj buggy_obj__anons"></td>
</tr>

<tr>
    <td class="cntForm-td-title"><div>Описание:</div></td>
    <td class="cntForm-td-object" colspan="2">
        {include file="widget/spaw2.tpl" varname="field[description]" editor_varname=description_ExtEditor editor=$content.item_fields.description_ExtEditor }
    </td>
</tr>

<tr>
    <td class="cntForm-td-title"><div>Производитель:</div></td>
    <td class="cntForm-td-object">
        <input type="text" class="text" name="field[procreator]" value="{$content.item_fields.procreator|escape}" maxlength="128" />
    </td>
    <td class="cntForm-td-error buggy_obj buggy_obj__procreator"></td>
</tr>

<tr>
    <td class="cntForm-td-title"><div>Цена(грн):</div></td>
    <td class="cntForm-td-object">
        <input type="text" class="text" name="field[cost]" value="{$content.item_fields.cost|escape}" size="11" maxlength="11" />
    </td>
    <td class="cntForm-td-error buggy_obj buggy_obj__cost"></td>
</tr>

{if $content.item_fields.profile_addby_item }
<tr>
    <td class="cntForm-td-title"><div class="light">Создано:</div></td>
    <td class="cntForm-td-object"><div class="light">{$content.item_fields.profile_addby_item.fname|escape} {$content.item_fields.profile_addby_item.lname|escape} ({$content.item_fields.profile_addby_item.email|escape})</div></td>
    <td></td>
</tr>
{/if}

{if $content.item_fields.t_created }
<tr>
    <td class="cntForm-td-title"><div class="light">Дата создания:</div></td>
    <td class="cntForm-td-object"><div class="light">{$content.item_fields.t_created|date}</div></td>
    <td></td>
</tr>
{/if}

{if $content.item_fields.t_updated }
<tr>
    <td class="cntForm-td-title"><div class="light">Дата модификации:</div></td>
    <td class="cntForm-td-object"><div class="light">{$content.item_fields.t_updated|date}</div></td>
    <td></td>
</tr>
{/if}

</table>

<div class="splitter padded"></div>

<table cellspacing="8" cellpadding="0">
<tr>
    <td>{include file="obj.button.tpl" name="Сохранить" onclick="cntForm_submit()" icon="save" }</td>
    <td width="25">&nbsp;</td>
    <td>{include file="obj.button.tpl" name="Отменить" link=$data.link_back icon="cancel" }</td>
</tr>
</table>

</center>

</form>
{include file="stddecor.form.close.tpl" }

{* ************************************************************************* *}

{if $content.media_add }
    <br />
    {include file="media/manager.tpl" title="Дополнительные фотографии" item_title="Фото %s" media=$content.media_add }
{/if}

{* ************************************************************************* *}